#include "Param.h"

Param::Param() {
	this->name = NULL;
	ready = false;
}

Param::Param( const char *name ) {
	this->name = name;
	ready = false;
}

Param::Param( Param &src ) {
	this->name = src.name;
}

void Param::throwNotReady() throw (NotReady) {
	char msg[1024];
	if (name != NULL)
		sprintf(msg, "'%s' parameter", name);
	else
		sprintf(msg, "Unknown parameter");

	throw new NotReady(msg);
}

const char *Param::getName() throw (NotReady) {
	if (!ready) throwNotReady();
	return name;
}